<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        


        <btn-primary title="this is a title">
           <template v-slot:first>

 <ul>
     <li v-for="item in 5" :key="item">{{item}}</li>
 </ul>
</template>
<template v-slot:first>
    <button>last</button>
</template>
        </btn-primary>
        <btn-primary :title="msg" @change2="change"></btn-primary>
</div>
<script>
    Vue.component("btn-primary",{
  data(){

      return{
          count:5

      }
      
  },
  props:["title"],
  methods:{
   plus() {
       this.count++;
   }
  },
  template:"<button @click='$emit(\"change2\",count,++count)'>{{count}}-{{title}}</button>"

    })
    let vm = new Vue({
        el: '#app',
        data: {
      msg:"this is a msg"
           
        },
        methods:{

            change(...val){
                console.log("子组件传值"+ val)
            }
        }
    })
</script>
</body>
</html>